package com.wkhyapp.lm.adapter;


import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wkhyapp.lm.R;
import com.wkhyapp.lm.http.vo.Goods;
import com.wkhyapp.lm.utils.ImageLoadUtil;
import com.wkhyapp.lm.utils.StringUtils;

import java.util.List;

/**
 * Created by Administrator on 2021-10-6.
 */

public class GoodsImagesListAdapter extends BaseQuickAdapter<Goods, BaseViewHolder> {

    public GoodsImagesListAdapter.callBack mCallBack;
    public GoodsImagesListAdapter(int layoutResId, List<Goods> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, final Goods item) {
        ImageView imageView = helper.getView(R.id.goods_iv);
        ImageLoadUtil.setRoundImage_Normal(mContext,item.getImg(),6,imageView);
        helper.setText(R.id.imgCount_tv,item.getImgCount()+"");
        helper.getView(R.id.goos_rl).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mCallBack.info(item);
            }
        });

    }
    public void  setCallBack(GoodsImagesListAdapter.callBack callBack){
        this.mCallBack = callBack;
    }


    public interface  callBack{


        void info(Goods item);
    }

}
